import 'package:flutter/material.dart';
import 'package:xiaomishop/app/service/MyScreenExtention.dart';

class PassTextFiled extends StatelessWidget {
  final String hintText;
  final void Function(String)? onChanged;

  const PassTextFiled({super.key, required this.hintText, this.onChanged});

  @override
  Widget build(BuildContext context) {
    return Container(
      alignment: Alignment.center,
      height: 120.ww,
      margin: EdgeInsets.only(top: 100.hh),
      padding: EdgeInsets.only(left: 40.hh),
      decoration: BoxDecoration(
          color: Colors.black12, borderRadius: BorderRadius.circular(20)),
      child: TextField(
        // autofocus: true,
        style: TextStyle(fontSize: 36.ss),
        keyboardType: TextInputType.number, //默认弹出数字键盘
        decoration: InputDecoration(
            hintText: hintText,
            contentPadding: const EdgeInsets.all(0), //输入框上下居中
            border: OutlineInputBorder(
              borderSide:
                  BorderSide(width: 3, color: Colors.red.withOpacity(0)),
            ),
            enabledBorder: OutlineInputBorder(
              borderSide:
                  BorderSide(width: 3, color: Colors.red.withOpacity(0)),
            ),
            focusedBorder: OutlineInputBorder(
              borderSide:
                  BorderSide(width: 3, color: Colors.red.withOpacity(0)),
            ),
            errorBorder: OutlineInputBorder(
              borderSide:
                  BorderSide(width: 3, color: Colors.red.withOpacity(0)),
            ),
            focusedErrorBorder: OutlineInputBorder(
              borderSide:
                  BorderSide(width: 3, color: Colors.red.withOpacity(0)),
            ) //去掉下划线
            ),
        onChanged: onChanged,
      ),
    );
  }
}
